package testRankers;

import java.util.Arrays;

import org.junit.Test;

import vsvm.data.filter.ranking.AbstractRankingFilter;
import vsvm.data.filter.ranking.Soap;
import vsvm.data.model.AbstractDataModel;

public class SoapTest extends AbstractRankerTest{

	@Test
	public void testScore() {
		AbstractRankingFilter ranker = new Soap();
		
		AbstractDataModel dataModel = getDataModel(mainPath + "data1", 0);
		ranker.setDataModel(dataModel);

		double[] correct = {5, 
						    2, 
						    2,
						    0,
						   };

		assertTrue(Arrays.equals(correct, ranker.score()));
		
		AbstractDataModel dataModel2 = getDataModel(mainPath + "data2", 0);
		ranker.setDataModel(dataModel2);

		double[] correct2 = {7,
						     0,
						    };

		assertTrue(Arrays.equals(correct2, ranker.score()));
		
		AbstractDataModel dataModel3 = getDataModel(mainPath + "data3", 0);
		ranker.setDataModel(dataModel3);

		double[] correct3 = {7,
						     0,
						    };

		assertTrue(Arrays.equals(correct3, ranker.score()));
		
		AbstractDataModel dataModel4 = getDataModel(mainPath + "data4", 0);
		ranker.setDataModel(dataModel4);

		double[] correct4 = {7,
						     0,
						    };

		assertTrue(Arrays.equals(correct4, ranker.score()));
	}

}
